<?php

namespace App\Models\Base;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\SoftDeletingScope;

class ServerList extends Model
{
    use SoftDeletes;
    /**
     * 值为true忽略软删除.
     *
     * @var bool
     */
    public static $soft = false;

    //游戏服的大区
    public function region()
    {
        return $this->belongsTo('App\Models\Base\Regional', 'reg_id');
    }

    public static function bootSoftDeletes()
    {
        if (self::$soft) {
            return true;
        }
        static::addGlobalScope(new SoftDeletingScope());
    }
}
